package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.text.format.DateUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.card.base.bean.BaseDistCardBean;
import com.huawei.appgallery.foundation.card.gamereserve.bean.BaseDecorateAppCardBean;
import com.huawei.appgallery.foundation.card.gamereserve.bean.OrderAppCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.foundation.ui.framework.widget.button.DownloadButton;
import com.huawei.hwid.core.constants.HwAccountConstants;
import huawei.widget.HwTextView;
import o.azb;
import o.cgz;
import o.dof;
import o.eqx;
import o.ewm.j;

public class OrderAppCard extends BaseDecorateAppCard {
    private View ʻ;
    private TextView ʼ;
    private TextView ॱॱ;

    public OrderAppCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ˏ((ImageView) view.findViewById(j.ʽﾞ));
        azb.ॱ(ʼॱ());
        azb.ˋ(view, j.ı);
        ˋ((DownloadButton) view.findViewById(j.ˋˋ));
        this.ʼ = (TextView) view.findViewById(j.ᵋ);
        this.ॱॱ = (TextView) view.findViewById(j.ᴵᐝ);
        this.ʻ = view.findViewById(j.ߵˋ);
        this.ˋ = (HwTextView) view.findViewById(j.ʻꜞ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        if (cardBean instanceof OrderAppCardBean) {
            ˋ((OrderAppCardBean) cardBean);
        }
        super.ˏ(cardBean);
        if (ˊᐝ()) {
            this.ʻ.setVisibility(0);
        } else {
            this.ʻ.setVisibility(8);
        }
    }

    public void w_() {
        eqx.ˏ(this.ʽॱ, this.ˊᐝ.ॱˌ(), "app_default_icon");
    }

    public void ॱ(BaseDistCardBean baseDistCardBean) {
        if (this.ˊ != null) {
            this.ˊ.setVisibility(0);
            this.ˊ.setParam(baseDistCardBean);
            ॱ(this.ˊ.ॱ());
        }
    }

    private void ˋ(OrderAppCardBean orderAppCardBean) {
        if (!(this.ʼ == null || orderAppCardBean.ʽᐝ() == null)) {
            this.ʼ.setText(orderAppCardBean.ʽᐝ());
        }
        if (this.ॱॱ != null && orderAppCardBean.ˊʻ() != null) {
            if (orderAppCardBean.ʽ() != 0) {
                this.ॱॱ.setText(DateUtils.formatDateTime(this.ʼॱ, orderAppCardBean.ʽ(), 16) + HwAccountConstants.BLANK + orderAppCardBean.ˊʻ());
            } else {
                this.ॱॱ.setText(orderAppCardBean.ˊʻ());
            }
        }
    }

    protected boolean ˊ(BaseDecorateAppCardBean baseDecorateAppCardBean) {
        if (baseDecorateAppCardBean.ʼˊ() != 7 || dof.ॱ(baseDecorateAppCardBean.ʻˊ())) {
            return super.ˊ(baseDecorateAppCardBean);
        }
        return true;
    }

    protected String ˎ() {
        return "gift";
    }
}
